package com.huangdada.hfweather.controller;

import com.huangdada.hfweather.bean.Weather;
import com.huangdada.hfweather.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: 获取天气数据controller
 * @PROJECT_NAME: hf-weather
 * @CLASS_NAME:
 * @Author: huanglibin
 * @Date: 2020-03-30 21:21
 * @Version: 1.0
 */
@RestController
@RequestMapping(name = "/weather")
public class WeatherController {

    @Autowired
    private WeatherService weatherService;

    /**
     * 查询所有实况天气信息
     * @return
     */
    @GetMapping("/getNowWeatherAll")
    public List<Weather> getNowWeatherAll(){
        return weatherService.queryWeatherAll();
    }
}
